﻿<!doctype html>
<html>
<head>
    <title>SpreadJS - Frozen Line and Viewport</title>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    
    <link href="../../../external/spreadjs/css/gcspread.sheets.excel2013white.9.40.20161.0.css" rel="stylesheet" type="text/css" />

    <script src="../../../external/external/jquery-1.8.2.min.js" type="text/javascript"></script>

    <script type="text/javascript" src="../../../external/spreadjs/gcspread.sheets.all.9.40.20161.0.min.js"></script>

    <style type="text/css">
        /*css_begin*/
        input[type="text"] {
            width: 80px;
        }

        label {
            display:inline-block;
            width: 200px;
        }

        input[type="button"] {
            margin-left: 204px;
            width: 84px;
        }
        /*css_end*/
    </style>

    <script id="scriptInit" type="text/javascript">
    /*code_begin*/
    $(document).ready(function () {
        var spread = new GcSpread.Sheets.Spread(document.getElementById("ss"));
        var sheet = spread.getSheet(0);
        sheet.setFrozenCount(2,2);

        $("#btnSetFrozenLine").click(function () {
            var sheet = spread.getActiveSheet();

            if ($("#rowCount").val()) {
                var rowCount = parseInt($("#rowCount").val());
                sheet.setFrozenRowCount(rowCount);
            }
            if ($("#trailingRowCount").val()) {
                var trailingRowCount = parseInt($("#trailingRowCount").val());
                sheet.setFrozenTrailingRowCount(trailingRowCount);
            }
            if ($("#columnCount").val()) {
                var columnCount = parseInt($("#columnCount").val());
                sheet.setFrozenColumnCount(columnCount);
            }
            if ($("#trailingColumnCount").val()) {
                var trailingColumnCount = parseInt($("#trailingColumnCount").val());
                sheet.setFrozenTrailingColumnCount(trailingColumnCount);
            }
        });
    });
    /*code_end*/
    </script>
</head>
<body>
    <div class="sample-turtorial">
        <div id="ss" style="width:100%; height:420px;border: 1px solid gray;"></div>
		<div class="demo-options">
            <div class="option-row">
                <label for="rowCount">FrozenRowCount:</label>
                <input type="text" id="rowCount" value="2" />
            </div>
            <div class="option-row">
                <label for="trailingRowCount">FrozenTrailingRowCount:</label>
                <input type="text" id="trailingRowCount" />
            </div>
            <div class="option-row">
                <label for="columnCount">FrozenColumnCount:</label>
                <input type="text" id="columnCount" value="2" />
            </div>
            <div class="option-row">
                <label for="trailingColumnCount">FrozenTrailingColumnCount:</label>
                <input type="text" id="trailingColumnCount"/>
            </div>
            <div class="option-row">
                <input type="button" value="Set" id="btnSetFrozenLine" />
            </div>
		</div>
    </div>
</body>
</html>